<?php $this->headLink()->appendStylesheet($this->dirCss.'/dialog.css');?>
<div id="dialog-wrapper">
    <div id="dialog-content">
    	
        <span id="close-btn"></span>
        <span id="dialog-message">YOUR JOB HAS BEEN SAVED IN DRAFTS FOLDER</span>
       
        <a href="javascript:" class="savejob-postjob">POST JOB
        <img id="post-img" src="<?php echo $this->dirImg."/postjob-icon.png"; ?>" alt="" /></a>
       
        <a href="<?php echo $this->baseUrl('employer/manage/draft'); ?>">GO TO DRAFT
        <img id="draft-img" src="<?php echo $this->dirImg."/dratf-icon.png" ?>" alt="" /></a>
        
        <div id="dialog-close-btn">
        </div><!-- END #dialog-close-btn -->
    </div><!-- #dialog-content -->
</div><!-- #dialog-wrapper -->
<script type="text/javascript">
	$(document).ready(function(e) {
        //Tính chiều cao của toàn bộ website
		var header = $('#header').height();
		var content = $('#main-content-bg').height();
		var footer = $('#footer').height();		
		var height = header  + content + 50 + footer;//50 padding top của content
		height = height + "px";		
		$('#dialog-wrapper').height(height);//Gán vào chiều cao của dialog-content
		
		//Button Postjob
		$('.savejob-postjob').click(function(){		
			var jobId = '&jobId='+<?php echo $this->jobId ?>+'&command=2';
			$.ajax({
				type: "POST",
				data: jobId,
				url: "<?php echo $this->baseUrl('employer/index/postjob/');?>",					
				dataType: "json",
				beforeSend: function (){
					
				},
				success: function(response){					
					if(response.result.code == 'OK'){							
						$( ".deleteMessages" ).html(response.result.message).dialog({
							resizable: false,
							width:400,
							height:145,
							modal: true,
							buttons: {
								OK: function(){
									window.location = "<?php echo $this->baseUrl('employer/manage');?>";	 
								}
							}
						});
						
					}
					else{
						$( ".deleteMessages" ).html(response.result.message).dialog({
							resizable: false,
							width:400,
							height:145,
							modal: true,
							buttons: {
								OK: function(){
									window.location = "<?php echo $this->baseUrl('employer/manage');?>";
								}
							}
						});						
					}
				}					
			});
		});
		
    });
</script>